﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework.Input;

namespace Pong_Project
{
    class Controls
    {
        private static InputHelper inputHelper = new InputHelper();

        public static void Update()
        {
            inputHelper.Update();
        }

        # region InputHelper methods
        public static bool IsNewPress(Keys key)
        {
            return inputHelper.IsNewPress(key);
        }

        public static bool IsNewPress(Buttons button)
        {
            return inputHelper.IsNewPress(button);
        }

        public static bool IsCurPress(Keys key)
        {
            return inputHelper.IsCurPress(key);
        }

        public static bool IsCurPress(Buttons button)
        {
            return inputHelper.IsCurPress(button);
        }

        public static bool IsOldPress(Keys key)
        {
            return inputHelper.IsOldPress(key);
        }

        public static bool IsOldPress(Buttons button)
        {
            return inputHelper.IsOldPress(button);
        }
        # endregion

        public static bool MuteSound
        {
            get { return IsNewPress(Keys.M); }
        }

        public static bool MoveUpLeftBat
        {
            get { return IsCurPress(Keys.W) || IsCurPress(Keys.A); }
        }

        public static bool MoveDownLeftBat
        {
            get { return IsCurPress(Keys.S) || IsCurPress(Keys.Z); }
        }

        public static bool MoveUpRightBat
        {
            get { return IsCurPress(Keys.Up); }
        }

        public static bool MoveDownRightBat
        {
            get { return IsCurPress(Keys.Down); }
        }

        public static bool Enter
        {
            get { return IsNewPress(Keys.Enter); }
        }

        public static bool MenuDown
        {
            get { return IsNewPress(Keys.Down); }
        }

        public static bool MenuUp
        {
            get { return IsNewPress(Keys.Up); }
        }
        public static bool MenuRight
        {
            get { return IsNewPress(Keys.Right); }
        }
        public static bool MenuLeft
        {
            get { return IsNewPress(Keys.Left); }
        }

        public static bool PauseGame
        {
            get { return IsNewPress(Keys.P) || IsNewPress(Keys.Escape); }
        }
    }
}
